<template>
  <div class="swiper">
    <el-carousel :interval="3000" arrow="always">
      <el-carousel-item v-for="(item, i) in img" :key="i">
        <span class="el-span">{{ i + 1 }}/{{ img.length }}</span>
        <img :src="item.limg" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>
<script>
export default {
  data() {
    return {
      img: [{ limg: "" }],
    };
  },
  mounted() {
    let rid = this.$route.query.rid;
    this.axios.get("/lbt?rid=" + rid).then((res) => {
      this.img = res.data;
      // console.log(this.img.length);
    });
  },
};
</script>
<style>
.el-span {
  width: 50px;
  height: 30px;
  position: absolute;
  right: 30px;
  top: 20px;
  font-size: 16px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
  line-height: 30px;
  color: aliceblue;
}
.el-carousel__arrow {
  height: 50px;
  width: 50px;
  background: rgba(0, 0, 0, 0.3);
}
.el-carousel__container {
  width: 780px;
  height: 488px;
  margin-bottom: 50px;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>